/*
 * Created by Dev c++ 5.11
 * Author: liyih
 * Date: 2018/03/16
 */

#include <iostream>
#include <stack>
#include <cctype>
#include <string>
#include <cstdio>
using namespace std;
int main()
{
	int i = 0;
	stack<char>a, b;
	string s;
	cin>>s;
	while(i < s.length()){
		if(s[i]!='+'&&s[i]!='-'&&s[i]!='*'&&s[i]!='/'&&s[i]!='('&&s[i]!=')'){
			a.push(s[i]);
		}
		else{
			if(s[i]=='('){
				b.push(s[i]);
			}
			else if(s[i]==')'){
				while(b.top()!='('){
					a.push(b.top());
					b.pop();
				}
				b.pop();
			}
			else if(s[i]=='+'||s[i]=='-'){
				while(!b.empty()){
					if(b.top()!='('){
						a.push(b.top());
						b.pop();
					}
					else break;
				}
				b.push(s[i]);
			}
			else if(s[i]=='*'||s[i]=='/'){
				while(!b.empty()){
					if(b.top()=='*' || b.top()=='/'){
						a.push(b.top());
						b.pop();
					}
					else break;
				}
				b.push(s[i]);
			}
			else NULL;
		}
		i++;
	}
	string ss;
	while(!b.empty()){
		a.push(b.top());
		b.pop();
	}
	while(!a.empty()){
		ss += a.top();
		a.pop();
	}
	i = ss.length()-1;
	while(i>=0){
		cout<<ss[i];
		i--;
	}
	return 0;

}
